#ifndef SDRAGON_WINDOW_H_INCLUDED
#define SDRAGON_WINDOW_H_INCLUDED

#include "SDragon_GeneralIncludes.h"

#include "SDR_Window.h"
#include "SDR_Surface.h"

#include "SDragon_Tools.h"
#include "SDragon_SurfaceList.h"
#include "SDragon_Cursor.h"
#include "SDragon_Event.h"
#include "SDragon_AnimationList.h"


SDR_Window * DLL_EXPORT SDR_Window_new();

void DLL_EXPORT SDR_Window_setTitle(const char * windowTitle);
void DLL_EXPORT SDR_Window_setIcon(SDL_Surface * windowIconSurface);

void DLL_EXPORT SDR_Window_setSDLFlags(SDR_Window * window, uint32_t flags);
void DLL_EXPORT SDR_Window_addSDLFlags(SDR_Window * window, uint32_t flags);
void DLL_EXPORT SDR_Window_resetSDLFlags(SDR_Window * window);
void DLL_EXPORT SDR_Window_setScreenFlags(SDR_Window * window, uint32_t flags);
void DLL_EXPORT SDR_Window_addScreenFlags(SDR_Window * window, uint32_t flags);
void DLL_EXPORT SDR_Window_setFullscreen(SDR_Window * window, uint8_t fullscreen);
void DLL_EXPORT SDR_Window_resetScreenFlags(SDR_Window * window);

void DLL_EXPORT SDR_Window_setCursor(SDR_Window * window, SDR_Cursor * cursor);

uint16_t DLL_EXPORT SDR_Window_init(SDR_Window * window);
void DLL_EXPORT SDR_Window_free(SDR_Window * window);
void DLL_EXPORT SDR_Window_quit(SDR_Window * window);

uint16_t DLL_EXPORT SDR_Window_loadScreen(SDR_Window * window);
void DLL_EXPORT SDR_Window_backupScreen(SDR_Window * window);

void DLL_EXPORT SDR_Window_updateScreen(SDR_Window * window);

uint8_t DLL_EXPORT SDR_Window_poolEvent(SDR_Window * window, SDL_Event * sdlEvent, SDR_Event * sdrEvent);



// Motors

int DLL_EXPORT SDR_Window_motor(void * data);
int DLL_EXPORT SDR_Animation_motor(void * data);

// Shortcut

#define SDR_newWindow(window) SDR_Window * window = SDR_Window_new()
#define SDR_init SDR_Window_init
#define SDR_quit SDR_Window_quit

#define SDR_withReload(window, function) function; SDR_Window_loadScreen(window)

#endif // SDRAGON_WINDOW_H_INCLUDED
